import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Main {
    public static void main(String[] args) {
        JFrame frame = new JFrame("窦贺");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(800, 600);
        JPanel panel = new JPanel();
        panel.setLayout(null);
        JButton button = new JButton("按钮");
        button.setBounds(20, 20, 100, 100);
        button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                button.setBounds(200, 200, 100, 100);
            }
        });
        panel.add(button);
        frame.add(panel);
        frame.setVisible(true);
        frame.setLocationRelativeTo(null);
    }
}

